package com.cn.lyl.service.impl;

import com.cn.lyl.dao.LeavingDao;
import com.cn.lyl.dao.impl.LeavingDaoImpl;
import com.cn.lyl.model.LeavingModel;
import com.cn.lyl.service.LeavingService;

import java.util.List;

public class LeavingServiceImpl implements LeavingService {
    @Override
    public List<LeavingModel> findAll(LeavingModel leavingModel) {
        LeavingDao leavingDao = new LeavingDaoImpl();
        return leavingDao.findAll(leavingModel);
    }

    @Override
    public LeavingModel findInfo(int id) {
        LeavingDao leavingDao = new LeavingDaoImpl();
        return leavingDao.findById(id);
    }

    @Override
    public String delete(int id) {
        LeavingDao leavingDao = new LeavingDaoImpl();
        return leavingDao.delete(id)>0?"success":"error";
    }
}
